package com.example.workapp;

import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    private Button btnStartTransferActivity;
    private Button btnVideoActivity;
    private Button btnEditActivity;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnStartTransferActivity = findViewById(R.id.btnStartTransferActivity);
        btnVideoActivity = findViewById(R.id.btnVideoActivity);
        btnEditActivity = findViewById(R.id.btnEditActivity);
        btnStartTransferActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 当按钮被点击时，启动 TransferFilesActivity
                Intent intent = new Intent(MainActivity.this, TransferFilesActivity.class);
                startActivity(intent);
            }
        });
        btnVideoActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 当按钮被点击时，启动传输视频流
//                Intent intent = new Intent(MainActivity.this, VideoActivity.class);
//                startActivity(intent);
                Intent videoTransIntent=new Intent(MainActivity.this, ScreenTrans.class);
                videoTransIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(videoTransIntent);
            }
        });
        btnEditActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 当按钮被点击时，启动 TransferFilesActivity
//                Intent intent = new Intent(MainActivity.this, EditFileActivity.class);
//                startActivity(intent);
                Intent editIntent=new Intent(MainActivity.this,CollaborativeEditor.class);
                editIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(editIntent);
            }
        });
    }
}
